package com.yykj.prescription.server.model.entity.template;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yykj.common.util.serializer.LocalDate2LongSerializer;
import com.yykj.prescription.client.enums.PrescriptionType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.time.LocalDateTime;

@Entity
@Data
public class PrescriptionTemplate {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    private Integer hospitalId;

    private String doctorId;

    @ApiModelProperty("模板名称")
    private String tempName;

    @ApiModelProperty("模板类型，west 西药方，china 中药方")
    @Enumerated(EnumType.STRING)
    private PrescriptionType type;

    @UpdateTimestamp
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    private LocalDateTime addTime;

    @ApiModelProperty("该模板使用次数")
    private Integer cnt = 0;

}
